import request from '@/utils/request'

// 查询产品促销管理列表
export function listPromotion(query) {
  return request({
    url: '/product/promotion/list',
    method: 'get',
    params: query
  })
}

// 查询产品促销管理详细
export function getPromotion(promotionId) {
  return request({
    url: '/product/promotion/' + promotionId,
    method: 'get'
  })
}

// 新增产品促销管理
export function addPromotion(data) {
  return request({
    url: '/product/promotion',
    method: 'post',
    data: data
  })
}

// 修改产品促销管理
export function updatePromotion(data) {
  return request({
    url: '/product/promotion',
    method: 'put',
    data: data
  })
}

// 删除产品促销管理
export function delPromotion(promotionId) {
  return request({
    url: '/product/promotion/' + promotionId,
    method: 'delete'
  })
}

// 导出产品促销管理
export function exportPromotion(query) {
  return request({
    url: '/product/promotion/export',
    method: 'get',
    params: query
  })
}